package org.dfg.corejava.lang;

import java.util.Date;

/**
 * 浅复制<br/>
 * 被复制对象的基本类型属性被复制，但是引用类型属性只是复制了引用<br/>
 * 本质上都是复制变量的“值”
 * 
 * @author Administrator
 */
public class CloneTest implements Cloneable {

	private Date date = new Date();

	public static void main(String[] args) throws CloneNotSupportedException,
			InterruptedException {
		CloneTest c1 = new CloneTest();
		Thread.sleep(1000);
		CloneTest c12 = new CloneTest();
		CloneTest c2 = (CloneTest) c1.clone();
		System.out.println(c1.date.getTime());
		System.out.println(c12.date.getTime());
		System.out.println(c2.date.getTime());
	}
}
